#import "CallDataLogic.h"
#import "EvaluateUserList.h"
@implementation CallDataLogic
-(void)getEvaluateListBlock:(CommonBlock)block
{
    NSString *url = [[CYURLUtils sharedCYURLUtils] makeURLWithC:@"page_data_api" A:@"request_get_evaluate_list"];
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    [CYNET POSTv3:url parameters:param responseCache:^(id responseObject) {
    } success:^(id responseObject) {
        NSArray *data = [NSArray modelArrayWithClass:[EvaluateModel class] json:[responseObject valueForKey:@"list"]];
        block(data);
    } failure:^(NSString *error, NSInteger code) {
    } hasCache:YES];
}
-(void)getUserEvaluateListWhthUid:(NSString *)uid AndPage:(NSString *)page Block:(CommonBlock)block
{
    NSString *url = [[CYURLUtils sharedCYURLUtils] makeURLWithC:@"personal_api" A:@"get_evaluate_list"];
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    [param setObject:SafeStr(uid) forKey:@"to_user_id"];
    [param setObject:SafeStr(page) forKey:@"page"];
    [CYNET POSTv3:url parameters:param responseCache:^(id responseObject) {
        NSArray *data = [NSArray modelArrayWithClass:[EvaluateUserList class] json:[responseObject valueForKey:@"evaluate_list"]];
        block(data);
    } success:^(id responseObject) {
    } failure:^(NSString *error, NSInteger code) {
    } hasCache:YES];
}
- (void)postEvaluateWithString:(NSString *)string  AndChannelId:(NSString *)cid andToUid:(NSString *)touid Block:(CommonBlock)block{
    if(StrValid(string))
    {
        NSString *url = [[CYURLUtils sharedCYURLUtils] makeURLWithC:@"user_api" A:@"request_submit_evaluate"];
        NSMutableDictionary *param = [NSMutableDictionary dictionary];
        [param setObject:string forKey:@"label_str"];
        [param setObject:SafeStr(cid) forKey:@"channel_id"];
        [param setObject:SafeStr(touid) forKey:@"to_user_id"];
        [CYNET POSTv3:url parameters:param responseCache:^(id responseObject) {
            block(nil);
        } success:^(id responseObject) {
            block(nil);
            [MBProgressHUD showTopTipMessage:ASLocalizedString(@"评价成功")];
        } failure:^(NSString *error, NSInteger code) {
            block(nil);
        } hasCache:NO];
    }
    else
    {
        block(nil);
    }
}
@end
